﻿Imports System.Runtime.InteropServices
Imports System.Windows.Interop

Partial Public Class ScreenWindow

    Private Sub Image_MouseLeftButtonDown(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
        DragMove()
    End Sub

    'Protected Overrides Sub OnSourceInitialized(ByVal e As System.EventArgs)
    '    MyBase.OnSourceInitialized(e)
    '    ' This can't be done any earlier than the SourceInitialized event:
    '    GlassHelper.ExtendGlassFrame(Me, New Thickness(0))
    'End Sub


    '<DllImport("user32.dll")> _
    'Private Shared Function SetWindowLong( _
    '    ByVal hWnd As IntPtr, _
    '    ByVal nIndex As Integer, _
    '    ByVal dwNewLong As Integer) As Integer
    'End Function

    '<DllImport("user32.dll", SetLastError:=True)> _
    'Private Shared Function SetWindowPos(ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As UInt32) As Boolean
    'End Function

    '<DllImport("user32.dll", SetLastError:=True)> _
    'Private Shared Function GetWindowLong( _
    '    ByVal hWnd As IntPtr, _
    '    ByVal nIndex As Integer) As Integer
    'End Function

    'Private Sub ScreenWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded

    '    Dim hwnd As IntPtr = New WindowInteropHelper(Me).Handle
    '    If hwnd = IntPtr.Zero Then
    '        Exit Sub
    '    End If

    '    Const GWL_STYLE As Integer = -16
    '    Const GWL_EXSTYLE As Integer = -20
    '    Const WS_SIZEBOX As Integer = &H40000
    '    Const WS_SYSMENU As Integer = &H80000
    '    Const WS_CLIPCHILDREN As Integer = &H2000000
    '    Const WS_CAPTION As Integer = &HC00000
    '    Const WS_MAXIMIZEBOX As Integer = &H10000
    '    Const WS_MINIMIZEBOX As Integer = &H20000
    '    Const WS_VISIBLE As Integer = &H10000000
    '    Const SWP_NOMOVE As Integer = &H8
    '    Const SWP_NOSIZE As Integer = &H12
    '    Const SWP_DRAWFRAME As Integer = &H20
    '    Const WS_EX_COMPOSITED As Integer = &H2000000
    '    Const WS_EX_TOOLWINDOW As Integer = &H80
    '    Const WS_EX_APPWINDOW As Integer = &H40000

    '    Dim style = GetWindowLong(hwnd, GWL_EXSTYLE) - WS_EX_APPWINDOW
    '    Dim ret = SetWindowLong(hwnd, GWL_STYLE, WS_SIZEBOX Or WS_SYSMENU Or WS_CLIPCHILDREN Or WS_CAPTION Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_VISIBLE)
    '    Dim b = SetWindowLong(hwnd, GWL_EXSTYLE, style Or WS_EX_COMPOSITED Or WS_EX_TOOLWINDOW)
    '    Dim a = SetWindowPos(hwnd, Nothing, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_DRAWFRAME)

    'End Sub
End Class
